import ollama

# 创建Ollama客户端实例
client = ollama.Client(host='http://localhost:11434')

# 列出所有可用的模型
# print("Available models:", client.list())

# 运行Qwen2.5-Coder模型并生成文本
response = client.generate(model="qwen2.5-coder:7b", prompt="Hello, how can I help you today?")
print("Generated text:", response.response)